import api from './index'
// axios
import request from '@/utils/request'
import qs from 'qs'
//
export function queryCompanyInfo(data) {
  return request({
    url: api.queryCompanyInfo,
    method: 'post',
    data: qs.stringify(data)
  })
}
//
export function getCompanyInfo(data) {
  return request({
    url: api.getCompanyInfo,
    method: 'post',
    data: qs.stringify(data)
  })
}
//
export function queryCompanyImage(data) {
  return request({
    url: api.queryCompanyImage,
    method: 'post',
    data: qs.stringify(data)
  })
}
//
export function queryProductCategory(data) {
  return request({
    url: api.queryProductCategory,
    method: 'post',
    data: qs.stringify(data)
  })
}
//
export function queryProductInfo(data) {
  return request({
    url: api.queryProductInfo,
    method: 'post',
    data: qs.stringify(data)
  })
}
//
export function getProductInfo(data) {
  return request({
    url: api.getProductInfo,
    method: 'post',
    data: qs.stringify(data)
  })
}
//
export function saveAgencyChat(data) {
  return request({
    url: api.saveAgencyChat,
    method: 'post',
    data: qs.stringify(data)
  })
}
//
export function queryPlatformProductCategory(data) {
  return request({
    url: api.queryPlatformProductCategory,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function getPrivacyPolicy(data) {
  return request({
    url: api.getPrivacyPolicy,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function saveApplySample(data) {
  return request({
    url: api.saveApplySample,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function saveShareInfo(data) {
  return request({
    url: api.addShareInfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function uploadShareImg(data) {
  return request({
    url: api.uploadfile,
    method: 'post',
    data: data
  })
}

/**
 * 查询圈子信息
 * @param data
 */
export function queryShareInfo(data) {
  return request({
    url: api.queryShareInfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 查询圈子信息
 * @param data
 */
export function addShareStoreInfo(data) {
  return request({
    url: api.addShareStoreInfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 点击查看增加一次阅读数
 * @param data
 */
export function editShareReadNum(data) {
  return request({
    url: api.editShareReadNum,
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 保存留言信息
 * @param data
 */
export function addShareLy(data) {
  return request({
    url: api.addShareLy,
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 保存留言信息
 * @param data
 */
export function queryShareLy(data) {
  return request({
    url: api.queryShareLy,
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 查询我发布的信息
 * @param data
 */
export function queryMySharedInfo(data) {
  return request({
    url: api.queryMySharedInfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 查询我收藏的信息
 * @param data
 */
export function queryMyStoredShareInfo(data) {
  return request({
    url: api.queryMyStoredShareInfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 查询我留言过的信息
 * @param data
 */
export function queryHasMyLyShareInfo(data) {
  return request({
    url: api.queryHasMyLyShareInfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 查询我留言过的信息
 * @param data
 */
export function queryAgencyinfo(data) {
  return request({
    url: api.queryAgencyinfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 查询我留言过的信息
 * @param data
 */
export function queryCompanylist(data) {
  return request({
    url: api.queryCompanylist,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function addLyhfinfo(data) {
  return request({
    url: api.addLyhfinfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

// 新增【请填写功能名称】
export function addReadLog(data) {
  return request({
    url: api.addReadLog,
    method: 'post',
    data: qs.stringify(data)
  })
}

// 新增【请填写功能名称】
export function Login(data) {
  console.log('登录：', data)
  console.log('登录加密：', qs.stringify(data))
  return request({
    url: api.Login,
    method: 'post',
    data: qs.stringify(data)
  })
}

// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
  return request({
    url: '/sqeybusiness/system/dict/data/type/' + dictType,
    method: 'get'
  })
}

// 查询业务员业绩列表
export function listAchievements(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/list',
    method: 'get',
    params: query
  })
}

export function examAchieList(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/examAchieList',
    method: 'get',
    hideloading: true,
    params: query
  })
}

export function examAchieListDai(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/examAchieListDai',
    method: 'get',
    params: query
  })
}

// 查询业务员业绩详细
export function getAchievements(achid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/' + achid,
    method: 'get'
  })
}

// 新增业务员业绩

export function addAchievements(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 修改业务员业绩
export function updateAchievements(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/updateAchievements',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 审核业务员业绩
export function examAchievements(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/examAchievements',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 删除业务员业绩

export function delAchievements(achid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/' + achid,
    method: 'delete'
  })
}

// 导出业务员业绩

export function exportAchievements(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/export',
    method: 'get',
    params: qs.stringify(query)
  })
}

// 查询业务员目标任务列表
export function listBusitask(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/list',
    method: 'get',
    params: data
  })
}

// 查询业务员目标任务详细
export function getBusitask(taskid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/' + taskid,
    method: 'get'
  })
}

// 新增业务员目标任务
export function addBusitask(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/addBusiTask',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 修改业务员目标任务
export function updateBusitask(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask',
    method: 'put',
    data: data
  })
}

// 删除业务员目标任务
export function delBusitask(taskid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/' + taskid,
    method: 'delete'
  })
}

// 导出业务员目标任务
export function exportBusitask(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/export',
    method: 'get',
    params: qs.stringify(query)
  })
}

// 查询省区列表
export function getProvinceList(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/getProvinceList',
    method: 'get',
    params: qs.stringify(query)
  })
}

// 查询部门销售任务列表
export function listDepttask(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/depttask/list',
    method: 'get',
    params: query
  })
}

// 查询部门销售任务详细
export function getDepttask(depttaskid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/depttask/' + depttaskid,
    method: 'get'
  })
}

// 修改部门销售任务
export function updateDepttask(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/depttask',
    method: 'put',
    data: data
  })
}

// 删除部门销售任务
export function delDepttask(depttaskid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/depttask/' + depttaskid,
    method: 'delete'
  })
}

// 导出部门销售任务
export function exportDepttask(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/depttask/export',
    method: 'get',
    params: query
  })
}

// 新增省区目标任务
export function addDeptTask(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/addDeptTask',
    method: 'post',
    data: data
  })
}

// 新增省区目标任务
export function queryUserInfo(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryUserInfo',
    method: 'post',
    data: data
  })
}

// 新增省区目标任务
export function queryDeptBusiTask(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryDeptBusiTask',
    method: 'post',
    data: data
  })
}

// 查询【请填写功能名称】列表
export function listCost(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/cost/list',
    method: 'get',
    params: query
  })
}

// 查询【请填写功能名称】详细
export function getCost(costid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/cost/' + costid,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function addCost(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/cost',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updateCost(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/cost',
    method: 'put',
    data: data
  })
}

// 删除【请填写功能名称】
export function delCost(costid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/cost/' + costid,
    method: 'delete'
  })
}

// 导出【请填写功能名称】
export function exportCost(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/cost/export',
    method: 'get',
    params: query
  })
}

// 导出【请填写功能名称】
export function queryJryj(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryJryj',
    method: 'post',
    params: data
  })
}

export function queryYwyAchievements(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryYwyAchievements',
    method: 'post',
    params: data
  })
}

export function queryMonthRanking(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryMonthRanking',
    method: 'post',
    params: data
  })
}

export function queryWeekRanking(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryWeekRanking',
    method: 'post',
    params: data
  })
}

export function queryYearRanking(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryYearRanking',
    method: 'post',
    params: data
  })
}

export function queryMonthStatics(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryMonthStatics',
    method: 'post',
    params: data
  })
}

export function queryTaskStatics(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryTaskStatics',
    method: 'post',
    params: data
  })
}

export function queryDeptAchDetail(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryDeptAchDetail',
    method: 'post',
    params: data
  })
}

export function queryDeptTaskDetail(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryDeptTaskDetail',
    method: 'post',
    params: data
  })
}

export function queryPsnlTaskDetail(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/busitask/queryPsnlTaskDetail',
    method: 'post',
    params: data
  })
}

export function testDrool(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/drool/test',
    method: 'post',
    params: data
  })
}

export function queryYwyDeductInfo(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/queryYwyDeductInfo',
    method: 'post',
    params: data
  })
}

export function updateUserPwd(oldPassword, newPassword) {
  const data = {
    oldPassword,
    newPassword
  }
  return request({
    url: '/sqeybusiness/system/user/profile/updatePwd',
    method: 'put',
    params: data
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/sqeybusiness/logout',
    method: 'post'
  })
}

export function queryProvinceList(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/queryProvinceList',
    method: 'post',
    params: data
  })
}

export function queryCityList(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/queryCityList',
    method: 'post',
    params: data
  })
}

export function queryWxuserList(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/queryWxuserList',
    method: 'post',
    params: data
  })
}

export function updateWxuserLxflag(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/updateWxuserLxflag',
    method: 'post',
    params: data
  })
}

export function queryUserPayroll(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/payroll/queryUserPayroll',
    method: 'post',
    params: data
  })
}

export function queryBakcAchive(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/queryBakcAchive',
    method: 'post',
    params: data
  })
}

export function confirmPayroll(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/payroll/confirmPayroll',
    method: 'post',
    params: data
  })
}

export function listAchDetail(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/achievements/listAchDetail',
    method: 'get',
    hideloading: true,
    params: data
  })
}

// 查询工作计划列表
export function listJobplan(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobplan/list',
    method: 'get',
    params: query
  })
}

// 查询工作计划详细
export function getJobplan(planid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobplan/' + planid,
    method: 'get'
  })
}

// 新增工作计划
export function addJobplan(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobplan',
    method: 'post',
    data: data
  })
}

// 修改工作计划
export function updateJobplan(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobplan',
    method: 'put',
    data: data
  })
}

// 删除工作计划
export function delJobplan(planid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobplan/' + planid,
    method: 'delete'
  })
}

// 导出工作计划
export function exportJobplan(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobplan/export',
    method: 'get',
    params: query
  })
}

// 查询当天工作内容
export function listJobrecord(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobrecord/list',
    method: 'get',
    params: query
  })
}

// 查询当天工作内容
export function getJobrecord(recordid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobrecord/' + recordid,
    method: 'get'
  })
}

// 新增当天工作内容

export function addJobrecord(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobrecord',
    method: 'post',
    data: data
  })
}

// 修改当天工作内容

export function updateJobrecord(data) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobrecord',
    method: 'put',
    data: data
  })
}

// 删除当天工作内容

export function delJobrecord(recordid) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobrecord/' + recordid,
    method: 'delete'
  })
}

// 导出当天工作内容

export function exportJobrecord(query) {
  return request({
    url: '/sqeybusiness/sqeybusiness/jobrecord/export',
    method: 'get',
    params: query
  })
}

export function addCustomer(data) {
  console.log(qs.stringify(data))
  return request({
    url: '/sqeyet/mobile/customer/addCustomer',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function queryYwyCustomer(data) {
  return request({
    url: '/sqeyet/mobile/customer/queryYwyCustomer',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function updateCustomer(data) {
  console.log(qs.stringify(data))
  return request({
    url: '/sqeyet/mobile/customer/updateCustomer',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function queryProductList(data) {
  console.log(qs.stringify(data))
  return request({
    url: '/sqeyet/mobile/product/queryProductList',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function addFhnotes(data) {
  console.log(qs.stringify(data))
  return request({
    url: '/sqeyet/mobile/fhnotes/addFhnotes',
    method: 'post',
    data: data
  })
}

export function getFhnoteById(data) {
  console.log(qs.stringify(data))
  return request({
    url: '/sqeyet/mobile/fhnotes/getFhnoteById',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function queryFhnotes(data) {
  return request({
    url: '/sqeyet/mobile/fhnotes/queryFhnotes',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function getWxconfigInfo(data) {
  return request({
    url: '/sqeyet/mobile/customer/getWxconfigInfo',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function querySjinfoList(query) {
  return request({
    url: api.querySjinfoList,
    method: 'get',
    params: query
  })
}

export function listSysarea(query) {
  return request({
    url: api.listSysarea,
    method: 'get',
    params: query
  })
}

export function querySjinfo(query) {
  return request({
    url: api.querySjinfo,
    method: 'get',
    params: query
  })
}

export function queryOrderinfoList(query) {
  return request({
    url: api.queryOrderinfoList,
    method: 'get',
    params: query
  })
}

export function queryRechargeinfoList(query) {
  return request({
    url: api.queryRechargeinfoList,
    method: 'get',
    params: query
  })
}

export function getHyinfo(query) {
  return request({
    url: api.getHyinfo,
    method: 'get',
    params: query
  })
}

export function queryHydjinfoList(query) {
  return request({
    url: api.queryHydjinfoList,
    method: 'get',
    params: query
  })
}

export function querySysConifgByKey(query) {
  return request({
    url: api.querySysConifgByKey,
    method: 'get',
    params: query
  })
}

export function addDzsjinfo(data) {
  return request({
    url: api.addDzsjinfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function queryDzsjinfoByHyid(query) {
  return request({
    url: api.queryDzsjinfoByHyid,
    method: 'get',
    params: query
  })  
}

export function updateHyinfo(data) {
  return request({
    url: api.updateHyinfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function addOrderappeal(data) {
  return request({
    url: api.addOrderappeal,
    method: 'post',
    data: qs.stringify(data)
  })
}


export function queryOrderappealList(query) {
  return request({
    url: api.queryOrderappealList,
    method: 'get',
    params: query
  })  
}

export function updateOrderappeal(data) {
  return request({
    url: api.updateOrderappeal,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function addHyinfo(data) {
  return request({
    url: api.addHyinfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function getAccessToken(query) {
  return request({
    url: api.getAccessToken,
    method: 'get',
    params: query
  }) 
}

export function getUserInfo(query) {
  return request({
    url: api.getUserInfo,
    method: 'get',
    params: query
  })
}

export function validateAccessToken(query) {
  return request({
    url: api.validateAccessToken,
    method: 'get',
    params: query  
  })
}

export function refreshAccessToken(query) {
  return request({
    url: api.refreshAccessToken,
    method: 'get',
    params: query
  })
}

export function queryHyinfoByOpenid(query) {
  return request({
    url: api.queryHyinfoByOpenid,
    method: 'get',
    params: query
  })
}

export function saveOrderinfo(data) {
  return request({
    url: api.saveOrderinfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function addOrderinfo(data) {
  return request({
    url: api.addOrderinfo,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function saveRechargehy(data) {
  return request({
    url: api.saveRechargehy,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function saveRecharge(data) {
  return request({
    url: api.saveRecharge,
    method: 'post',
    data: qs.stringify(data)
  })
}

export function getShareparam(query) {
  return request({
    url: api.getShareparam,
    method: 'get',
    params: query
  })
}

export function queryRecharsetting(query) {
  return request({
    url: api.queryRecharsetting,
    method: 'get',
    params: query
  })
}


export function addXqinfo(data) {
  return request({
    url: api.addXqinfo,
    method: 'post',
    data: qs.stringify(data)
  })
}